void swap(int* a, int* b)
{
	int tmp = *a;
	*a = *b;
	*b = tmp;
}

void QueckSort(int* a, int begin, int end)
{
	if (begin == end)
		return;
	int left = begin;
	int right = end;
	int key = begin;
	while (left < right)
	{
		while (left < right && a[key] <= a[right])
		{
			right--;
		}
		while (left < right && a[key] >= a[left])
		{
			left++;
		}
		if (left < right)
			swap(&a[left], &a[right]);
	}
	int meet = left;
	swap(&a[key], &a[meet]);
	QueckSort(a, begin, meet - 1);
	QueckSort(a, meet + 1, end);
}